import asyncio
from wechaty import Wechaty, Message, Room

class MyBot(Wechaty):
    async def on_message(self, msg:Message):
        print(f"Recv:{msg.talker()},  content:{msg.text}")
    
    async def forward_message(self, sender, content, room_name):
        print(f"forward : {sender.name}: {content}")

async def main():
    bot = MyBot()
    await bot.start()
    
if __name__ == '__main__':
    asyncio.run(main())

# import itchat
# import requests

# # 
# SERVICE_URL = "http://localhost/service"

# # @itchat.msg_register(itchat.content.TEXT)
# # def forward_msg(msg):
# #         print(f"recv:{msg}")
# #         feedback = f"FeedBack:{msg}"
# #         itchat.send( feedback, toUserNmae="风华")


# itchat.auto_login(hotReload=True)
# print("Send Helllo")
# itchat.send("Hello....", toUserName='filehelper')

# #itchat.run()